.class public Lnet/tsapps/topdeals/DealListActivity;
.super Lnet/tsapps/topdeals/abstractactivities/BaseActivity;


# instance fields
.field private i:Lnet/tsapps/topdeals/d/a;

.field private j:Lnet/tsapps/topdeals/objects/InitialResponse;

.field private k:Lcom/viewpagerindicator/TitlePageIndicator;

.field private l:Lnet/tsapps/topdeals/views/TdViewPager;

.field private m:Ljava/lang/Thread;


# direct methods
.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Lnet/tsapps/topdeals/abstractactivities/BaseActivity;-><init>()V

    return-void
.end method

.method static synthetic a(Lnet/tsapps/topdeals/DealListActivity;)V
    .locals 1

    const/4 v0, 0x0

    invoke-direct {p0, v0}, Lnet/tsapps/topdeals/DealListActivity;->b(Z)V

    return-void
.end method

.method static synthetic a(Lnet/tsapps/topdeals/DealListActivity;Lnet/tsapps/topdeals/g/a;)V
    .locals 0

    invoke-virtual {p0, p1}, Lnet/tsapps/topdeals/DealListActivity;->a(Lnet/tsapps/topdeals/g/a;)V

    return-void
.end method

.method static synthetic b(Lnet/tsapps/topdeals/DealListActivity;)Lnet/tsapps/topdeals/h/a;
    .locals 1

    iget-object v0, p0, Lnet/tsapps/topdeals/DealListActivity;->b:Lnet/tsapps/topdeals/h/a;

    return-object v0
.end method

.method private b(Z)V
    .locals 4

    iget-object v0, p0, Lnet/tsapps/topdeals/DealListActivity;->m:Ljava/lang/Thread;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lnet/tsapps/topdeals/DealListActivity;->m:Ljava/lang/Thread;

    invoke-virtual {v0}, Ljava/lang/Thread;->isAlive()Z

    move-result v0

    if-eqz v0, :cond_0

    :goto_0
    return-void

    :cond_0
    new-instance v0, Lnet/tsapps/topdeals/v;

    invoke-direct {v0, p0, p1}, Lnet/tsapps/topdeals/v;-><init>(Lnet/tsapps/topdeals/DealListActivity;Z)V

    const-string v1, "Deals werden aktualisiert..."

    invoke-virtual {p0, v1}, Lnet/tsapps/topdeals/DealListActivity;->b(Ljava/lang/String;)V

    new-instance v1, Ljava/lang/Thread;

    const/4 v2, 0x0

    const-string v3, "MagentoBackground"

    invoke-direct {v1, v2, v0, v3}, Ljava/lang/Thread;-><init>(Ljava/lang/ThreadGroup;Ljava/lang/Runnable;Ljava/lang/String;)V

    iput-object v1, p0, Lnet/tsapps/topdeals/DealListActivity;->m:Ljava/lang/Thread;

    iget-object v0, p0, Lnet/tsapps/topdeals/DealListActivity;->m:Ljava/lang/Thread;

    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    goto :goto_0
.end method

.method static synthetic c(Lnet/tsapps/topdeals/DealListActivity;)Lnet/tsapps/topdeals/objects/InitialResponse;
    .locals 1

    iget-object v0, p0, Lnet/tsapps/topdeals/DealListActivity;->j:Lnet/tsapps/topdeals/objects/InitialResponse;

    return-object v0
.end method

.method static synthetic d(Lnet/tsapps/topdeals/DealListActivity;)Lnet/tsapps/topdeals/views/TdViewPager;
    .locals 1

    iget-object v0, p0, Lnet/tsapps/topdeals/DealListActivity;->l:Lnet/tsapps/topdeals/views/TdViewPager;

    return-object v0
.end method

.method private e()V
    .locals 4

    iget-object v0, p0, Lnet/tsapps/topdeals/DealListActivity;->m:Ljava/lang/Thread;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lnet/tsapps/topdeals/DealListActivity;->m:Ljava/lang/Thread;

    invoke-virtual {v0}, Ljava/lang/Thread;->isAlive()Z

    move-result v0

    if-eqz v0, :cond_0

    :goto_0
    return-void

    :cond_0
    new-instance v0, Lnet/tsapps/topdeals/ab;

    invoke-direct {v0, p0}, Lnet/tsapps/topdeals/ab;-><init>(Lnet/tsapps/topdeals/DealListActivity;)V

    new-instance v1, Ljava/lang/Thread;

    const/4 v2, 0x0

    const-string v3, "MagentoBackground"

    invoke-direct {v1, v2, v0, v3}, Ljava/lang/Thread;-><init>(Ljava/lang/ThreadGroup;Ljava/lang/Runnable;Ljava/lang/String;)V

    iput-object v1, p0, Lnet/tsapps/topdeals/DealListActivity;->m:Ljava/lang/Thread;

    iget-object v0, p0, Lnet/tsapps/topdeals/DealListActivity;->m:Ljava/lang/Thread;

    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    goto :goto_0
.end method

.method static synthetic e(Lnet/tsapps/topdeals/DealListActivity;)V
    .locals 0

    invoke-direct {p0}, Lnet/tsapps/topdeals/DealListActivity;->f()V

    return-void
.end method

.method private f()V
    .locals 2

    const v0, 0x7f05000f

    invoke-virtual {p0, v0}, Lnet/tsapps/topdeals/DealListActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    const/16 v1, 0x8

    invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V

    return-void
.end method

.method static synthetic f(Lnet/tsapps/topdeals/DealListActivity;)V
    .locals 0

    invoke-virtual {p0}, Lnet/tsapps/topdeals/DealListActivity;->b()V

    return-void
.end method

.method static synthetic g(Lnet/tsapps/topdeals/DealListActivity;)Lnet/tsapps/topdeals/d/a;
    .locals 1

    iget-object v0, p0, Lnet/tsapps/topdeals/DealListActivity;->i:Lnet/tsapps/topdeals/d/a;

    return-object v0
.end method

.method static synthetic h(Lnet/tsapps/topdeals/DealListActivity;)V
    .locals 0

    invoke-direct {p0}, Lnet/tsapps/topdeals/DealListActivity;->e()V

    return-void
.end method


# virtual methods
.method protected final a()V
    .locals 4

    iget-object v0, p0, Lnet/tsapps/topdeals/DealListActivity;->m:Ljava/lang/Thread;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lnet/tsapps/topdeals/DealListActivity;->m:Ljava/lang/Thread;

    invoke-virtual {v0}, Ljava/lang/Thread;->isAlive()Z

    move-result v0

    if-eqz v0, :cond_0

    :goto_0
    return-void

    :cond_0
    new-instance v0, Lnet/tsapps/topdeals/ac;

    invoke-direct {v0, p0}, Lnet/tsapps/topdeals/ac;-><init>(Lnet/tsapps/topdeals/DealListActivity;)V

    const-string v1, "Lade vorherige Deals..."

    invoke-virtual {p0, v1}, Lnet/tsapps/topdeals/DealListActivity;->b(Ljava/lang/String;)V

    new-instance v1, Ljava/lang/Thread;

    const/4 v2, 0x0

    const-string v3, "MagentoBackground"

    invoke-direct {v1, v2, v0, v3}, Ljava/lang/Thread;-><init>(Ljava/lang/ThreadGroup;Ljava/lang/Runnable;Ljava/lang/String;)V

    iput-object v1, p0, Lnet/tsapps/topdeals/DealListActivity;->m:Ljava/lang/Thread;

    iget-object v0, p0, Lnet/tsapps/topdeals/DealListActivity;->m:Ljava/lang/Thread;

    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    goto :goto_0
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 4

    invoke-super {p0, p1}, Lnet/tsapps/topdeals/abstractactivities/BaseActivity;->onCreate(Landroid/os/Bundle;)V

    const v0, 0x7f030001

    invoke-virtual {p0, v0}, Lnet/tsapps/topdeals/DealListActivity;->setContentView(I)V

    invoke-virtual {p0}, Lnet/tsapps/topdeals/DealListActivity;->c()V

    if-eqz p1, :cond_0

    const-string v0, "response"

    invoke-virtual {p1, v0}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v0

    check-cast v0, Lnet/tsapps/topdeals/objects/InitialResponse;

    iput-object v0, p0, Lnet/tsapps/topdeals/DealListActivity;->j:Lnet/tsapps/topdeals/objects/InitialResponse;

    :goto_0
    new-instance v0, Lnet/tsapps/topdeals/d/a;

    iget-object v1, p0, Lnet/tsapps/topdeals/DealListActivity;->b:Lnet/tsapps/topdeals/h/a;

    iget-object v2, p0, Lnet/tsapps/topdeals/DealListActivity;->j:Lnet/tsapps/topdeals/objects/InitialResponse;

    new-instance v3, Lnet/tsapps/topdeals/u;

    invoke-direct {v3, p0}, Lnet/tsapps/topdeals/u;-><init>(Lnet/tsapps/topdeals/DealListActivity;)V

    invoke-direct {v0, p0, v1, v2, v3}, Lnet/tsapps/topdeals/d/a;-><init>(Landroid/content/Context;Lnet/tsapps/topdeals/h/a;Lnet/tsapps/topdeals/objects/InitialResponse;Landroid/view/View$OnClickListener;)V

    iput-object v0, p0, Lnet/tsapps/topdeals/DealListActivity;->i:Lnet/tsapps/topdeals/d/a;

    const v0, 0x7f05000d

    invoke-virtual {p0, v0}, Lnet/tsapps/topdeals/DealListActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lnet/tsapps/topdeals/views/TdViewPager;

    iput-object v0, p0, Lnet/tsapps/topdeals/DealListActivity;->l:Lnet/tsapps/topdeals/views/TdViewPager;

    iget-object v0, p0, Lnet/tsapps/topdeals/DealListActivity;->l:Lnet/tsapps/topdeals/views/TdViewPager;

    iget-object v1, p0, Lnet/tsapps/topdeals/DealListActivity;->i:Lnet/tsapps/topdeals/d/a;

    invoke-virtual {v0, v1}, Lnet/tsapps/topdeals/views/TdViewPager;->a(Landroid/support/v4/view/a;)V

    const v0, 0x7f05000c

    invoke-virtual {p0, v0}, Lnet/tsapps/topdeals/DealListActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/viewpagerindicator/TitlePageIndicator;

    iput-object v0, p0, Lnet/tsapps/topdeals/DealListActivity;->k:Lcom/viewpagerindicator/TitlePageIndicator;

    iget-object v0, p0, Lnet/tsapps/topdeals/DealListActivity;->k:Lcom/viewpagerindicator/TitlePageIndicator;

    iget-object v1, p0, Lnet/tsapps/topdeals/DealListActivity;->l:Lnet/tsapps/topdeals/views/TdViewPager;

    invoke-virtual {v0, v1}, Lcom/viewpagerindicator/TitlePageIndicator;->a(Landroid/support/v4/view/ViewPager;)V

    iget-object v0, p0, Lnet/tsapps/topdeals/DealListActivity;->k:Lcom/viewpagerindicator/TitlePageIndicator;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lcom/viewpagerindicator/TitlePageIndicator;->a(I)V

    const v0, 0x7f05002c

    invoke-virtual {p0, v0}, Lnet/tsapps/topdeals/DealListActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    new-instance v1, Lnet/tsapps/topdeals/z;

    invoke-direct {v1, p0}, Lnet/tsapps/topdeals/z;-><init>(Lnet/tsapps/topdeals/DealListActivity;)V

    invoke-virtual {v0, v1}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    const v0, 0x7f05002d

    invoke-virtual {p0, v0}, Lnet/tsapps/topdeals/DealListActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    new-instance v1, Lnet/tsapps/topdeals/aa;

    invoke-direct {v1, p0}, Lnet/tsapps/topdeals/aa;-><init>(Lnet/tsapps/topdeals/DealListActivity;)V

    invoke-virtual {v0, v1}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    iget-object v0, p0, Lnet/tsapps/topdeals/DealListActivity;->j:Lnet/tsapps/topdeals/objects/InitialResponse;

    invoke-virtual {v0}, Lnet/tsapps/topdeals/objects/InitialResponse;->a()I

    move-result v0

    if-nez v0, :cond_1

    invoke-direct {p0}, Lnet/tsapps/topdeals/DealListActivity;->e()V

    :goto_1
    return-void

    :cond_0
    new-instance v0, Lnet/tsapps/topdeals/objects/InitialResponse;

    invoke-direct {v0}, Lnet/tsapps/topdeals/objects/InitialResponse;-><init>()V

    iput-object v0, p0, Lnet/tsapps/topdeals/DealListActivity;->j:Lnet/tsapps/topdeals/objects/InitialResponse;

    goto :goto_0

    :cond_1
    invoke-direct {p0}, Lnet/tsapps/topdeals/DealListActivity;->f()V

    goto :goto_1
.end method

.method protected onCreateDialog(I)Landroid/app/Dialog;
    .locals 4

    const/4 v2, 0x0

    packed-switch p1, :pswitch_data_0

    const/4 v0, 0x0

    :goto_0
    return-object v0

    :pswitch_0
    new-instance v0, Landroid/app/AlertDialog$Builder;

    iget-object v1, p0, Lnet/tsapps/topdeals/DealListActivity;->a:Landroid/content/Context;

    invoke-direct {v0, v1}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

    const-string v1, "Fehler beim Laden der Deals.\nErneut versuchen?"

    invoke-virtual {v0, v1}, Landroid/app/AlertDialog$Builder;->setMessage(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;

    move-result-object v1

    invoke-virtual {v1, v2}, Landroid/app/AlertDialog$Builder;->setCancelable(Z)Landroid/app/AlertDialog$Builder;

    move-result-object v1

    const-string v2, "Ja"

    new-instance v3, Lnet/tsapps/topdeals/w;

    invoke-direct {v3, p0}, Lnet/tsapps/topdeals/w;-><init>(Lnet/tsapps/topdeals/DealListActivity;)V

    invoke-virtual {v1, v2, v3}, Landroid/app/AlertDialog$Builder;->setPositiveButton(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    move-result-object v1

    const-string v2, "Nein"

    new-instance v3, Lnet/tsapps/topdeals/x;

    invoke-direct {v3, p0}, Lnet/tsapps/topdeals/x;-><init>(Lnet/tsapps/topdeals/DealListActivity;)V

    invoke-virtual {v1, v2, v3}, Landroid/app/AlertDialog$Builder;->setNegativeButton(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    invoke-virtual {v0}, Landroid/app/AlertDialog$Builder;->create()Landroid/app/AlertDialog;

    move-result-object v0

    goto :goto_0

    :pswitch_1
    new-instance v0, Landroid/app/AlertDialog$Builder;

    iget-object v1, p0, Lnet/tsapps/topdeals/DealListActivity;->a:Landroid/content/Context;

    invoke-direct {v0, v1}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

    const-string v1, "Update verf\u00fcgbar."

    invoke-virtual {v0, v1}, Landroid/app/AlertDialog$Builder;->setTitle(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;

    const-string v1, "Es wurde eine neue Top Deals Version gefunden.\n\nBitte aktualisiere die App um Top Deals weiterhin benutzen zu k\u00f6nnen."

    invoke-virtual {v0, v1}, Landroid/app/AlertDialog$Builder;->setMessage(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;

    move-result-object v1

    invoke-virtual {v1, v2}, Landroid/app/AlertDialog$Builder;->setCancelable(Z)Landroid/app/AlertDialog$Builder;

    move-result-object v1

    const-string v2, "Jetzt aktuallisieren"

    new-instance v3, Lnet/tsapps/topdeals/y;

    invoke-direct {v3, p0}, Lnet/tsapps/topdeals/y;-><init>(Lnet/tsapps/topdeals/DealListActivity;)V

    invoke-virtual {v1, v2, v3}, Landroid/app/AlertDialog$Builder;->setPositiveButton(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    move-result-object v1

    const-string v2, "Abbrechen"

    new-instance v3, Lnet/tsapps/topdeals/a;

    invoke-direct {v3, p0}, Lnet/tsapps/topdeals/a;-><init>(Lnet/tsapps/topdeals/DealListActivity;)V

    invoke-virtual {v1, v2, v3}, Landroid/app/AlertDialog$Builder;->setNegativeButton(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    invoke-virtual {v0}, Landroid/app/AlertDialog$Builder;->create()Landroid/app/AlertDialog;

    move-result-object v0

    goto :goto_0

    nop

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method

.method protected onNewIntent(Landroid/content/Intent;)V
    .locals 2

    invoke-super {p0, p1}, Lnet/tsapps/topdeals/abstractactivities/BaseActivity;->onNewIntent(Landroid/content/Intent;)V

    const-string v0, "refresh"

    const/4 v1, 0x1

    invoke-virtual {p1, v0, v1}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z

    move-result v0

    if-eqz v0, :cond_0

    const-string v0, "refreshviewpager"

    const/4 v1, 0x0

    invoke-virtual {p1, v0, v1}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z

    move-result v0

    invoke-direct {p0, v0}, Lnet/tsapps/topdeals/DealListActivity;->b(Z)V

    :cond_0
    return-void
.end method

.method protected onSaveInstanceState(Landroid/os/Bundle;)V
    .locals 2

    const-string v0, "response"

    iget-object v1, p0, Lnet/tsapps/topdeals/DealListActivity;->j:Lnet/tsapps/topdeals/objects/InitialResponse;

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putParcelable(Ljava/lang/String;Landroid/os/Parcelable;)V

    invoke-super {p0, p1}, Lnet/tsapps/topdeals/abstractactivities/BaseActivity;->onSaveInstanceState(Landroid/os/Bundle;)V

    return-void
.end method
